package com.hw01.exception;

/**
 * @ClassName GlobalException
 * @Description 自定义项目最等层异常
 * @Author Kx
 * @Date 2025/5/13 19:29
 * @Version 1.0
 */
public class GlobalException extends RuntimeException {
    // 自定义错误码
    private final Integer errorCode;

    public GlobalException(Integer errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    /**
     * @author: kx
     * @date: 2025/5/13 19:30
     * @return java.lang.Integer
     * @description: 获取错误码
    */
    public Integer getErrorCode() {
        return errorCode;
    }
}
